# 6. 更新数据
import sqlite3

from mysql.create_db import cursor, conn

try:
    cursor.execute("UPDATE users SET age = ? WHERE name = ?", (26, "Alice"))
    conn.commit()
    print("\n数据更新成功")
except sqlite3.Error as e:
    print(f"更新失败：{e}")
    conn.rollback()

